package com.biaobiaoqi.scoreanalysis.administrator.action;

import java.util.List;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.biaobiaoqi.scoreanalysis.hibernate.bean.SchoolYear;
import com.biaobiaoqi.scoreanalysis.service.ISchoolyearService;
import com.opensymphony.xwork2.ActionSupport;

public class ListSchoolYear extends ActionSupport {
	private static final Log log = LogFactory.getLog(ListSchoolYear.class);
	private static final long serialVersionUID = 1196342452390541403L;
	private int currentPage = 0;
	private List<SchoolYear> list;

	@Resource
	ISchoolyearService schoolyearService;

	public String execute() {
		log.debug("list school year");
		try {
			list = schoolyearService.listSchoolYear(currentPage * 9, 9);
			return SUCCESS;
		} catch (Exception e) {
			log.error("list school year failed",e);
			return ERROR;
		}
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public List<SchoolYear> getList() {
		return list;
	}

	public void setList(List<SchoolYear> list) {
		this.list = list;
	}

	public ISchoolyearService getSchoolyearService() {
		return schoolyearService;
	}

	public void setSchoolyearService(ISchoolyearService schoolyearService) {
		this.schoolyearService = schoolyearService;
	}
}
